package service

import (
	"ginblog/enum"
	"ginblog/model"
)

type ProfileService struct {
}

type ProfileSerInterface interface {
	ProfileOne(name string) (model.Profile, enum.Code)
}

func (ser ProfileService) ProfileOne(name string) (model.Profile, enum.Code) {
	var profile model.Profile

	err := db.Where("name = ?", name).First(&profile).Error
	if err != nil {
		return profile, enum.ERROR
	}
	return profile, enum.SUCCESS
}
